#!/bin/sh

# Set these paths appropriately

BIN=/home/user/Downloads/TreeTagger/bin
CMD=/home/user/Downloads/TreeTagger/cmd
LIB=/home/user/Downloads/TreeTagger/lib

GERMANTAGGER=${CMD}/tree-tagger-german
TAGGER=${BIN}/tree-tagger
PARFILE=${LIB}/german.par
PARFILE2=${LIB}/german-chunker.par
FILTER=${CMD}/filter-chunker-output-german.perl

$GERMANTAGGER $* |
perl -nae 'if ($#F==0){print}else{print "$F[0]-$F[1]\n"}' |
$TAGGER $PARFILE2 -token -sgml -eps 0.00000001 -hyphen-heuristics -quiet |
$FILTER |
$TAGGER -quiet -token -lemma -sgml $PARFILE
